<!DOCTYPE html>
<html>
    <head lang="en">
        <meta charset="UTF-8">
        <script>
        function draw(id){
            var canvas =document.getElementById(id);
            if(canvas ==null){
                return false;
            }
            var context =canvas.getContext("2d");
            context.fillStyle="blue";
            context.fillRect(0,0,500,500);
            context.translate(200,50);
            context.fillStyle="rgba(255,0,0,0.25)";
            for( var i=0;i<50;i++){
                context.translate(25,25);
                context.scale(0.95,0.95);
                context.rotate(Math.PI/10);
                context.fillRect(0,0,100,50);
            }
        }
        </script>
    </head>
    <body onload="draw('canvas')">
        <canvas id="canvas" width="500" height="500"></canvas>
        
    </body>
</html>